Skip to content

docs: migrate to @sentry/starlight-theme#996

Merged
betegon merged 12 commits into
mainfrom
jr/migrate-docs-starlight-theme
May 22, 2026
Merged

docs: migrate to @sentry/starlight-theme#996
betegon merged 12 commits into
mainfrom
jr/migrate-docs-starlight-theme

Conversation

@sentry-junior
Copy link
Copy Markdown
Contributor

@sentry-junior sentry-junior Bot commented May 21, 2026

Summary

Migrate the CLI docs site from a custom 1900-line dark theme to the shared @sentry/starlight-theme package.

Changes

Added

  • @sentry/starlight-theme — shared Starlight plugin with dark-only theme, component overrides (Header, Footer, ThemeSelect, Pagination), and monochrome code highlighting
  • docs/src/styles/cli.css — slim (~250 lines) of CLI-specific styles (splash page, feature sections, overscroll easter egg)

Removed

  • docs/src/styles/custom.css — 1869 lines of custom dark theme CSS (now provided by the shared theme)
  • docs/src/components/ThemeProvider.astro — dark-mode forcing (theme handles this)
  • docs/src/components/ThemeSelect.astro — empty theme select (theme handles this)
  • docs/src/components/Header.astro — custom header (theme provides its own)
  • docs/src/components/CodeBlock.astro — unused
  • docs/src/components/CommandBox.astro — unused (imported but never rendered)
  • Custom expressiveCode config with github-dark theme

Updated

  • astro.config.mjs — uses sentryStarlightTheme() plugin and monochromeCodeTheme
  • @astrojs/starlight bumped to ^0.39.2 (theme peer dependency)
  • astro bumped to ^6.3.5
  • InstallSelector.astro — uses monochrome theme instead of github-dark for Shiki highlighting
  • Component font references updated from hardcoded 'JetBrains Mono' to var(--sl-font-mono)
  • PageTitle.astro — uses theme design tokens (--ve-*)

Kept (CLI-specific)

  • InstallSelector, PackageManagerCode, Terminal, FeatureTerminal, FeatureVisual, PageTitle components
  • Splash/landing page layout and feature section CSS
  • Overscroll easter egg
  • Google Fonts (Inter + JetBrains Mono)
  • Plausible analytics, OG images
  • @sentry/astro integration and sourcemap config

Visual changes expected

  • Syntax highlighting switches from github-dark to monochrome (shared theme)
  • Header follows shared theme design (GitHub link moves to footer social links)
  • Sidebar, code blocks, tabs, and content styling follow shared theme defaults
  • Overall color palette is very similar (same #0a0a0f background, same #8b5cf6 purple accent)

Notes

  • The lockfile (bun.lock) needs regeneration after merging — run cd docs && bun install
  • Visual review of the PR preview is recommended, especially the landing page and command reference pages

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 4235 uncovered lines.
✅ Project coverage is 81.86%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.86%    81.86%        —%
==========================================
  Files          328       328         —
  Lines        23349     23349         —
  Branches     15114     15114         —
==========================================
+ Hits         19115     19114        -1
- Misses        4234      4235        +1
- Partials      1620      1620         —

Generated by Codecov Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-996/

Built to branch gh-pages at 2026-05-22 11:06 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread docs/astro.config.mjs
Comment on lines 2 to 6
import { codeToTokens } from 'shiki';
import { monochromeCodeTheme } from '@sentry/starlight-theme';

interface InstallOption {
label: string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: A shiki version mismatch in InstallSelector.astro may cause syntax-highlighted text to render as invisible due to an incompatible theme object from a v4-based package.
Severity: MEDIUM

Suggested Fix

To resolve the version mismatch, either upgrade the top-level shiki dependency in package.json to a shiki v4 compatible version, or ensure the monochromeCodeTheme object is backwards-compatible with shiki v3's codeToTokens API.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: docs/src/components/InstallSelector.astro#L2-L6

Potential issue: In `InstallSelector.astro`, the `codeToTokens` function is imported
from the top-level `shiki` dependency (v3.21.0), but it is called with
`monochromeCodeTheme`, a theme object from `@sentry/starlight-theme` which is designed
for `shiki` v4. This version mismatch may cause the `codeToTokens` function to return
tokens where the `color` property is `undefined`. As a result, the component will render
invisible text for the install commands on the homepage, as the style will be set to
`color: undefined`.

Did we get this right? 👍 / 👎 to inform future reviews.

dcramer added a commit to getsentry/junior that referenced this pull request May 21, 2026
…ttribution (#392)

Extend `github-code` from a GitHub CLI command reference into a compact
repo-edit and PR workflow skill. Folds in the high-value behavioral
rules from `code-change` (junior-prod) that were previously buried in
reference files the model wasn't reliably loading (see getsentry/cli#996
for the attribution miss that motivated this).

**On-behalf-of attribution is inline, not in references**

`Co-authored-by` trailers, `Action taken on behalf of Full Name.`
footer, and session link are all in the main SKILL.md workflow steps
where the model can't miss them.

**Investigation and verification discipline added**

Read referenced context, inspect real product/UI context before
inventing content, know failure shape before editing bugs, re-root-cause
after failed fixes. Choose a validation path before editing (scoped
checks > targeted tests > full suites). Capture baselines for risky
work. Separate pre-existing failures from regressions.

**Edit discipline added**

Keep public surfaces minimal, remove duplication introduced by the
change, solve the behavior not just the tests. Compact checklist for
multi-step work. Pause-and-plan for non-obvious
architecture/security/concurrency work.

**Commit and PR conventions inline**

`type(scope): Subject` format, footer ordering, line length, draft PRs
by default, reviewer-facing prose, handle resolution before assignment.

**api-surface.md expanded**

Added git commands for branch, status, log, diff, commit. Defaulted PR
creation to `--draft`.

**Intentionally not included**

Full advisor protocol (orchestration-level, not GitHub ops),
`diff-quality` gate (separate skill), exhaustive verification harness
table (conditional detail better as progressive disclosure),
multi-viewport screenshot protocol.

Refs getsentry/cli#996

Action taken on behalf of David Cramer.

---
[View Session in
Sentry](https://sentry.sentry.io/traces/?project=4510944073809921&query=gen_ai.conversation.id%3A%22slack%3AC0B595QDZLL%3A1779338726.095499%22)

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <david@sentry.io>
Comment thread docs/src/styles/cli.css
Comment thread docs/src/components/InstallSelector.astro
sentry-junior Bot and others added 12 commits May 22, 2026 13:04
Replace the 1900-line custom dark theme CSS and hand-rolled component
overrides with the shared @sentry/starlight-theme Starlight plugin.

Changes:
- Add @sentry/starlight-theme dependency and plugin to astro config
- Use monochromeCodeTheme for syntax highlighting (replaces github-dark)
- Bump @astrojs/starlight to ^0.39.2 (theme peer dep)
- Remove custom ThemeProvider, ThemeSelect, Header components
  (now provided by the shared theme)
- Remove CodeBlock, CommandBox (unused)
- Replace 1869-line custom.css with ~250-line cli.css containing only
  CLI-specific styles (splash page, feature sections, overscroll)
- Update font references in components to use CSS custom properties
- Update InstallSelector to use shared monochrome code theme
- Use theme design tokens (--ve-*) in PageTitle
- Re-add custom Header component (derived from theme's Header pattern)
  with CLI-specific features: homepage detection, 'Docs' nav link,
  hide search on splash page, social icons in header
- Restore the purple/blue ambient gradient glow (.main-frame::before)
- Style social icons white in header
The shared theme's --sl-content-width (50rem/800px) is too narrow for
the splash page feature sections which use side-by-side layouts with
wide ASCII terminal art. The terminal tables blow out the flex layout
and crush the text column to near-zero width.

Fix:
- Widen the splash page container to 68rem (~1088px) matching production
- Add overflow: hidden + min-width: 0 on .feature-visual to prevent
  terminal content from expanding the flex item beyond 55%
1. Header: on docs pages, use the theme's standard header (text title +
   search) instead of the branded logo header. The homepage keeps the
   logo + 'Docs' link + GitHub icon. Removed replacesTitle so docs
   pages show 'Sentry CLI' as text, not the logo SVG.

2. Tabs: updated PackageManagerCode tabs from underline-style to the
   theme's pill-style (rounded, purple accent background on active tab)
   to match Starlight tab styling from @sentry/starlight-theme.
Header:
- Removed logo from Starlight config entirely (no longer shows on
  any page by default)
- Homepage Header renders the logo SVG manually via an img tag
- Docs pages show plain text 'Sentry CLI' title with search — no logo

Code blocks:
- PackageManagerCode code area bg changed from hardcoded #0a0a0f to
  var(--ve-code-bg) to match the theme's code block background
Code blocks:
- Bumped @sentry/starlight-theme from ^0.2.0 to ^0.3.0 — v0.2.0 had
  --ve-code-bg: #111 which made code blocks darker than intended.
  v0.3.0 uses #141419, matching the theme playground reference.

Homepage header:
- Removed the 'Sentry CLI' text from the homepage header — now shows
  just the wordmark SVG logo like production does. The text next to
  the logo icon looked redundant.
@betegon betegon force-pushed the jr/migrate-docs-starlight-theme branch from 4ba6c97 to b8a62ea Compare May 22, 2026 11:05
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b8a62ea. Configure here.

Comment thread docs/src/components/InstallSelector.astro
Comment thread docs/src/components/PackageManagerCode.astro
@betegon betegon merged commit c064547 into main May 22, 2026
29 checks passed
@betegon betegon deleted the jr/migrate-docs-starlight-theme branch May 22, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant